//    Copyright (C) Kherty.  All rights reserved.
using System;

namespace OpenLS.Spreadsheet.Extensibility
{
    public class AllowDoubleToDateTimeConversionAttribute : ParameterConverterAttribute
    {
        internal override void ConvertImp(ConversionData data)
        {
            if (data.TargetType == typeof(DateTime) && data.Value is double)
            {
                double dbl = (double)data.Value;
                data.Result = data.Workbook.DoubleToDateTime(dbl);
            }
        }
    }
}